package com.tx.admin.modules.rbac.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;

import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;

import com.alibaba.excel.annotation.ExcelProperty;
import com.tx.admin.core.entity.SuperEntity;
import com.tx.admin.core.anno.JpaKey;
import com.tx.admin.modules.rbac.column.ListStringType;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Entity
@Data
@TypeDef(name = "ListStringType", typeClass = ListStringType.class)
@ApiModel("角色")
public class RoleEntity extends SuperEntity{

	@ApiModelProperty("名称")
	private String title;
	
	//数据权限id集合
	@ApiModelProperty("函数权限")
	@Column(columnDefinition="text")
	@ExcelProperty(value="函数权限")
    @Type(type="ListStringType")
	private List<String> dataPermissionIds;
		
	@ApiModelProperty("数据集合")
	@Column(columnDefinition="text")
	@ExcelProperty(value="数据权限")
    @Type(type="ListStringType")
	private List<String> dataFunctionIds;
	
	@ApiModelProperty("角色类型")
	@ExcelProperty(value="角色类型")
	@JpaKey(content=true)
	private String roleType;

	@Override
	public void init() {
		super.init();

	}
}
